<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title></title>
    <link href="../../plugins/mui/mui.min.css" rel="stylesheet" />
    <style>
        .header{
            background: #2a2c33;
        }
        .header h1{
            color:#fff;
            font-size:18px;
        }
        .header a{
            color:#fff;
        }
    </style>
</head>
<body>
<header class="mui-bar mui-bar-nav header">
    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
    <h1 class="mui-title"></h1>
</header>
<script src="../../plugins/mui/mui.min.js"></script>
<script type="text/javascript">
    mui.init({


    })
    mui.plusReady(function(){
        var wait = plus.nativeUI.showWaiting('正在加载中...');
        main = plus.webview.currentWebview();
        document.getElementsByClassName('mui-title')[0].innerHTML=main.title;
        var content = plus.webview.create(main.dataHref,'content',{
            top: '45px',
            bottom: '0',
            bounce: 'vertical',
            background:'transparent'
        });
        main.append(content);
        content.addEventListener('loaded',function(){
            console.log('close');
            wait.close();
        });
        //重写back事件，三方链接返回优化
        var back = function(){
            main.close();
        }
        mui.back = function(){
            content.canBack(function(event){
                var canBack = event.canBack;
                if(canBack){
                    content.back();
                }else{
                    back();
                }
            })
        }
    })
</script>
</body>
</html>